(function($){
	window.onload = function() {

		var script = document.createElement('script');
		script.type = 'text/javascript';
		script.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyAuBWJtxkiuJGQ_IpfGxJJFAnoLSE59DVo&sensor=false&'
				+ 'callback=initialize&language=zh-CN';
		document.body.appendChild(script);

	};
})(jQuery);


function initialize() {
	navigator.geolocation.getCurrentPosition(function(position){
		var initialLoc = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
		var mapOptions = {
			zoom: 16,
			mapTypeId: google.maps.MapTypeId.ROADMAP,
			center: initialLoc,
			panControl : false,
			zoomControl : false,
			scaleControl : false,
			streetViewControl : false,
			overviewMapControl : false,
			mapTypeControl : false
		};
		var map1 = window.map = new google.maps.Map(document.getElementById("mapContainer"),mapOptions);
		var marker1 = new google.maps.Marker({
			visible: true,
			position: initialLoc,
			map: map1
		});
		window.latitude=position.coords.latitude;
		window.longitude=position.coords.longitude;
		
	});
	
	
}